#! /usr/bin/python
import sys

Nsubchannels = 16
Nsubcarriers = 48
Permseq      = [6,14,2,3,10,8,11,15,9,1,13,12,5,7,4,0]
DL_Permbase  = 0

a=[[0]*Nsubcarriers]*Nsubchannels
for k in range(Nsubcarriers): 
    sys.stdout.write('\n')
    for s in range(Nsubchannels):
        Nk = (k+13*s)%Nsubcarriers
        a[s][k] = Nsubchannels * Nk + (Permseq[(Nk+s)%Nsubchannels]+DL_Permbase)%Nsubchannels
        sys.stdout.write('%5d'%(a[s][k]))
        sys.stdout.write(' ')
        
sys.stdout.write('\n')
